<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
layout:decorator="frame-layout">
	<head>
		<title>Saturn 注册中心管理</title>
		<link href="/webjars/datatables/1.10.11/css/dataTables.bootstrap.min.css" rel="stylesheet" />
	</head>
	<body>
		<div th:remove="tag" layout:fragment="content">
			<div id="wrapper">
		        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		            <div class="navbar-header">
		                <a class="navbar-brand" href="#">Saturn Console 注册中心管理</a>
		            </div>
		         </nav>
	   		 </div>
			<div class="panel panel-default">
				<div class="panel-heading" style="padding-bottom: 2px; padding-top: 2px;">
					<div class="panel-title">
						<span class="pull-left" style="margin-top: 6px;"><i class="fa fa-reorder"></i> 注册中心信息</span>
						<div class="pull-right">
							<button id="refresh_registry_center" class="btn btn-info" data-loading-text="刷新中...">刷新注册中心</button>
						</div>
						<span class="clearfix"></span>
					</div>
				</div>
				<div class="panel-body">
					<ul class="nav nav-tabs" role="tablist">
			            <li id="namespace_info_tab" role="presentation" class="active"><a href="#namespace_info_tabpanel" aria-controls="namespace_info_tabpanel" role="tab" data-toggle="tab"><i class="fa fa-area-chart"></i> 在线域信息</a></li>
			            <li id="zk_cluster_info_tab" role="presentation"><a href="#zk_cluster_info_tabpanel" aria-controls="zk_cluster_info_tabpanel" role="tab" data-toggle="tab"><i class="fa fa-server fa-1x"></i> 集群信息</a></li>
			            <li id="namespace_zkcluster_manager_tab" role="presentation"><a href="#namespace_zkcluster_manager_tabpanel" aria-controls="namespacezk_cluster_manager_tabpanel" role="tab" data-toggle="tab"><i class="fa fa-server fa-1x"></i> 域与集群管理</a></li>
			        </ul>
			        <br />
			        <div class="tab-content">
			            <div role="tabpanel" class="tab-pane active" id="namespace_info_tabpanel">
							<table id="namespace_info_table" class="table table-hover table-bordered">
								<thead>
									<tr>
										<th>域名</th>
										<th>业务组</th>
										<th>Executor版本</th>
										<th>zkClusterKey</th>
									</tr>
								</thead>
								<tbody></tbody>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane" id="zk_cluster_info_tabpanel">
							<table id="zk_cluster_info_table" class="table table-hover table-bordered">
								<thead>
									<tr>
										<th>zkClusterKey</th>
										<th>别名</th>
										<th>连接地址</th>
									</tr>
								</thead>
								<tbody></tbody>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane" id="namespace_zkcluster_manager_tabpanel">
							<table id="namespace_zkcluster_manager_table" class="table table-hover table-bordered">
								<thead>
									<tr>
										<th><input id="namespace_zkcluster_manager_table_select_all" type="checkbox"/></th>
										<th>域名</th>
										<th>zkClusterKey</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>最近更新时间</th>
										<th>最近更新人</th>
									</tr>
								</thead>
								<tbody></tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
			<!-- 批量迁移 -->
			<div class="modal" id="move-namespace-batch-dialog" tabindex="-1" role="dialog">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title">批量域迁移</h4>
						</div>
						<div class="modal-body form-horizontal">
							<div class="form-group">
								<label for="move-namespace-batch-dialog-namespace" class="col-sm-3 control-label text-right">域名</label>
								<div class="col-sm-8">
									<pre id="move-namespace-batch-dialog-namespace"></pre>
								</div>
							</div>
							<div class="form-group">
								<label for="move-namespace-batch-dialog-zkCluster" class="col-sm-3 control-label text-right">目标集群</label>
								<div class="col-sm-6">
									<select id="move-namespace-batch-dialog-zkCluster" class="form-control"></select>
									<input type="text" id="move-namespace-batch-dialog-zkCluster-input" class="form-control typeahead" style="display:none" />
								</div>
								<div class="col-sm-2">
									<button id="move-namespace-batch-dialog-manual" type="button" class="btn btn-success" status="auto">手动输入</button>
								</div>
							</div>
							<div class="form-group">
								<label for="move-namespace-batch-dialog-updateDBOnly" class="col-sm-3 control-label text-right">只更新映射表</label>
								<div class="col-sm-8">
									<input id="move-namespace-batch-dialog-updateDBOnly" type="checkbox" style="height:28px" />
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default input-sm" data-dismiss="modal">关闭</button>
							<button id="move-namespace-batch-dialog-confirm-btn" data-loading-text='请求中...' type="button" class="btn btn-danger ladda-button" data-style="expand-right">
								<span class="ladda-label">批量迁移</span>
							</button>
						</div>
					</div>
				</div>
			</div>
			<!-- 批量迁移状态 -->
			<div class="modal" id="move-namespace-batch-status-dialog" tabindex="-1" role="dialog" style="z-index:1056;">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<h4 class="modal-title">状态（批量域迁移到<span id="move-namespace-batch-status-dialog-zkCluster"></span>）</h4>
						</div>
						<div class="modal-body form-horizontal">
							<div class="form-group">
								<label for="move-namespace-batch-status-dialog-data" class="col-sm-2 control-label text-right">迁移量</label>
								<div class="col-sm-9">
									<pre id="move-namespace-batch-status-dialog-data"></pre>
								</div>
							</div>
							<div class="form-group">
								<label for="move-namespace-batch-status-dialog-moving" class="col-sm-2 control-label text-right">正在迁移</label>
								<div class="col-sm-9">
									<pre id="move-namespace-batch-status-dialog-moving"></pre>
								</div>
							</div>
							<div class="form-group">
								<font class="col-sm-11" color="green" size="2">注：忽略的域，指该域已经处于目标集群</font>
							</div>
							<div class="form-group" id="move-namespace-batch-status-dialog-tips">
								<font class="col-sm-11" color="red">执行中，请耐心等待^v^</font>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" id="move-namespace-batch-status-dialog-x" class="btn btn-default">完成</button>
						</div>
					</div>
				</div>
			</div>
			<!-- giveMeYes -->
			<div class="modal" id="confirm-yes-dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="z-index:1056;">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="confirm-yes-dialog-title">
							</h4>
						</div>
						<div class="modal-body form-horizontal">
							<div class="form-group">
								<div class="col-sm-12">
									<input type="text" id="giveMeYes" class="form-control" />
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default input-sm" data-dismiss="modal">关闭</button>
							<button id="confirm-yes-dialog-confirm-btn" data-loading-text='请求中...' type="button" class="btn btn-danger ladda-button" data-style="expand-right">
								<span class="ladda-label">确认</span>
							</button>
						</div>
					</div>
				</div>
			</div>
			<div th:replace="fragments :: success-dialog"></div>
			<div th:replace="fragments :: failure-dialog(id='failure-dialog', reason='')"></div>
			<div th:replace="fragments :: confirm-dialog(id='confirm-dialog', text='')"></div>
		</div>
		<div th:remove="tag" layout:fragment="footer-scripts">
			<script src="/webjars/datatables/1.10.11/js/jquery.dataTables.min.js"></script>
			<script src="/webjars/datatables/1.10.11/js/dataTables.bootstrap.min.js"></script>
			<script src="js/registry_center.js?v=saturn-console-ui-version"></script>
		</div>
	</body>
</html>
